package com.wx.mall.sys.controller;


import com.wx.mall.common.utils.DataResult;
import com.wx.mall.sys.service.IPermissionService;
import com.wx.mall.sys.vo.resp.PermissionRespNodeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author j
 * @since 2020-03-18
 */
@RestController
@RequestMapping("/permission")
@Api(tags = "权限管理")
public class PermissionController {
    @Autowired
    private IPermissionService iPermissionService;

    @GetMapping("/permission/tree")
    @ApiOperation("菜单权限树接口-递归查询")
    public DataResult getAllPermissionTree() {
        List<PermissionRespNodeVO> allByTree = iPermissionService.findAllByTree();
        return DataResult.success(allByTree);
    }
}

